#Returns ERROR ratio, rejected ratio and error matrix
function [errs rejected errmx] = evaluateWithConfidence (net, data, labels, conf)
	if(max(labels)==9)
		labels=labels.+1;
	end;
	classNo = size(unique(labels),1);
	errmx=zeros(classNo, classNo+1);
	[answers confidence] = tellClass(data, net);
    answers(confidence<conf)=classNo+1;	
    indices = [labels, answers];
    
	for(i=1:size(indices,1))
		errmx(indices(i,1),indices(i,2))+=1;
	end
    rejected = sum(answers==classNo+1)/size(labels,1);
	errs=sum(answers!=labels)/size(labels,1)-rejected;
end;



	

